package com.jie.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author jie
 * @since 2024-07-10
 */
@TableName("run_track")
@Data
public class RunTrack implements Serializable {

    private static final long serialVersionUID=1L;

    /**
     * 跑步轨迹id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 跑步轨迹流程开始时间
     */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    // 格式化
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime runStartTime;

    /**
     * 跑步轨迹流程结束时间（这个是由发起者数据同步的）
     */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    // 格式化
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField("run_end_time")
    private LocalDateTime runEndTime;

    private String roomName;
    /**
     * 路线id（这个如果没有就是不关联）
     */
    @TableField("path_id")
    private Integer pathId;
    /**
     * 当前跑步的状态 0是开启，1是关闭
     */
    @TableField("run_status")
    private Integer runStatus;
    /**
     * 发起人的userId
     */
    private Integer userId;
    /**
     * 是否多人组队 0：不组，1：组队
     */
    private Integer isTeam;
    /**
     * 房间号 需要多人组队的时候生成
     */
    private String roomId;
    /**
     * 房间限定人数
     */
    private Integer roomPeople;
    /**
     * 创建时间
     */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    // 格式化
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    // 格式化
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}
